
import javax.swing.*;

import java.awt.event.*;
import java.awt.*;

public class TitleWin implements ActionListener
{
	//instantiating the window
	JFrame frame=new JFrame("Connect4");
	
	//constructor
	public TitleWin()
	{
		//set parameters
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		//Buttons etc.
		Container content=frame.getContentPane();
		JButton start=new JButton("Go");
		content.setLayout(new BoxLayout(frame.getContentPane(),BoxLayout.PAGE_AXIS));
		
		//ActionListener
		start.addActionListener(this);
		
		//Add picture
		java.net.URL imgURL = getClass().getResource("connect4.jpg");
		ImageIcon image = new ImageIcon(imgURL);
		JLabel imageLabel = new JLabel("", image, JLabel.CENTER);
		
		//Display Window
		frame.setSize(400,400);
		frame.setLocationRelativeTo(null);
		start.setAlignmentX(Component.CENTER_ALIGNMENT);
		imageLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
		content.add(start);
		content.add(imageLabel);
		
		frame.setVisible(true);
	}
	
	
	//"start" button clicked event
	public void actionPerformed(ActionEvent action) 
	{
		frame.dispose();
		//instantiate sizing window
		new SizingWindow();
	}
}
